Fix/intune anomalies 1.2.1#8
Merged
Merged
Conversation
added 4 commits
June 18, 2026 11:25
…per-request fallback Graph occasionally returns the same deviceCompliancePolicyState id twice for one device (multi-assignment paths), producing duplicate sub-request ids in the batch and a 400 'Request Id ... has to be unique in a batch.' Dedupe pairs via HashSet at the build site. When a sub-request still returns non-200 (any reason), fall back to a per-request GET so the Noncompliant Reason column gets the real rule name instead of 'Unknown'.
…error body The catch block previously retried any exception with exponential backoff, turning a permanent 400 BadRequest into a 62s hang (2+4+8+16+32). Now it inspects the HTTP status, retries only 408/429/5xx (and unknown/network errors), and surfaces $_.ErrorDetails.Message via Write-Verbose so the actual Graph rejection reason shows up in the trace.
Long unbreakable strings (UPNs, device serials, group GUIDs) overflowed their column and bled into the neighbouring cell. Add word-break / overflow-wrap to the shared .table tbody td rule so every report (not just Intune Anomalies) wraps long values inside their cell.
There was a problem hiding this comment.
Pull request overview
This PR publishes patch release 1.2.1 of the RKSolutions PowerShell module, focused on improving reliability and performance of the Intune Anomalies compliance-details fetch (Graph $batch) and fixing HTML report table overflow for long values.
Changes:
- Bump module version to 1.2.1 and add a dated CHANGELOG entry describing the patch fixes.
- Improve Graph
$batchbehavior: fast-fail non-transient HTTP errors, log Graph error bodies, and add a per-request fallback when$batchsub-requests fail. - Update shared report template CSS to wrap long strings inside table cells across reports.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| module/RKSolutions.psd1 | Bumps ModuleVersion to 1.2.1. |
| module/Private/Invoke-RKGraphBatch.ps1 | Adds HTTP-status-based retry policy and verbose logging of Graph error bodies. |
| module/Private/IntuneAnomalies.ps1 | Dedupes compliance setting-state pair IDs and adds per-request fallback for failed batch sub-requests. |
| module/Private/Get-RKSolutionsReportTemplate.ps1 | Adds CSS to wrap/break long table cell values. |
| CHANGELOG.md | Adds 1.2.1 release notes and date. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1452
to
+1456
| $states = @($resp.Body.value | Where-Object { $_.State -eq 'nonCompliant' -or $_.State -eq 'Error' }) | ||
| if ($states.Count -eq 0 -or $states.Count -gt 10) { continue } | ||
| $ComplianceRulesByDevice[$deviceId] = [System.Collections.Generic.List[string]]::new() | ||
| foreach ($s in $states) { | ||
| $pairId = "ss:$deviceId|$($s.id)" |
The <=10 cap was counting raw Graph results, so a device with duplicated policy-state entries (multi-assignment paths) could be skipped entirely even when its unique state count was within the limit. Dedupe per (deviceId, stateId) before the count guard; this also makes the in-loop HashSet check redundant since the pair build can no longer see duplicates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
8f0b6aa release: bump ModuleVersion to 1.2.1 and cut dated CHANGELOG section
fa79c1d fix(report-template): wrap long values in table cells across all reports
2ee7348 fix(invoke-rkgraphbatch): fast-fail non-transient HTTP and log Graph error body
94e7ea8 fix(intune-anomalies): dedupe compliance setting-state pairs and add per-request fallback
f05b1f2 Merge pull request #7 from royklo/feature/intune-anomalies-bitlocker-laps ← origin/main